home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / AppWannabe / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  2.3 KB  |  92 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        Start.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1989-1993 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19.  
  20.  
  21. /*****************************************************************************/
  22.  
  23.  
  24.  
  25. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  26. #include "App.protos.h"        /* Get the prototypes for application.            */
  27.  
  28. #ifndef __TEXTSERVICES__
  29. #include <TextServices.h>
  30. #endif
  31.  
  32. #ifndef __TOOLUTILS__
  33. #include <ToolUtils.h>
  34. #endif
  35.  
  36.  
  37.  
  38. /*****************************************************************************/
  39.  
  40.  
  41.  
  42. extern void _DataInit();
  43.  
  44. short    gQuickBalloons;
  45.  
  46.  
  47.  
  48. /*****************************************************************************/
  49. /*****************************************************************************/
  50.  
  51.  
  52.  
  53. #pragma segment Main
  54. void    main(void)
  55. {
  56.  
  57. #ifdef applec
  58.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  59. #endif
  60.  
  61.     SetApplLimit(GetApplLimit() - 16384);
  62.         /* This decreases the application heap by 16k, which in turn
  63.         ** increases the stack by 16k. */
  64.  
  65.     MaxApplZone();                    /* Expand the heap so code segments load at the top. */
  66.  
  67.     Initialize(32, kMinHeap, kMinSpace, nil, nil);    /* Initialize the program. */
  68.     DoSetResCursor(watchCursor);                    /* Rest of startup may take a while. */
  69.     InitRequiredAppleEvents();
  70.     InitWFMTAppleEvents();
  71.     CLVInitialize();
  72.     GetWindowFormats();                        /* Get the window definition resource information. */
  73.     OpenRuntimeOnlyAutoNewWindows();
  74.     DoOpenApplication();
  75.     DoAdjustMenus();
  76.     StartDocuments();                        /* Open (or print) designated documents for 6.0. */
  77.  
  78.     if(CTEUseTSMTE())
  79.         InitTSMAwareApplication();
  80.  
  81.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  82.     EventLoop();                    /* Call the main event loop. */
  83.  
  84.     if(CTEUseTSMTE())
  85.         CloseTSMAwareApplication();
  86.  
  87.     ExitToShell();                    /* Quit the application. */
  88. }
  89.  
  90.  
  91.  
  92.